May 1996

Configuring the Devices and Systems files for cu

By Al Alexander

If you've read the article "Using the cu Utility with Solaris 2.x" in our December 1995 issue, you may have started using the cu command to communicate with remote systems via a modem. In this article, we'll examine the process of configuring your Devices and Systems files to make using the cu program a little easier.

Background

The command you'll use to dial out is called cu, for Call UNIX. This command is a part of a much larger communication facility known as UUCP, or UNIX to UNIX CoPy. The entire UUCP suite of tools allows you to perform remote logins to other systems, copy files to and from other sites, and send E-mail to remote users--all via modem connections.

UUCP is now standard on all UNIX platforms. On UNIX System V Release 4 systems, such as Solaris, it is also referred to as the Basic Networking Utilities, or BNU. Configuring your system for dial-out capability with the cu command is the beginning of the entire UUCP configuration.

Configuring the Devices file

In our original article, we didn't cover system configuration. Thus, if your system wasn't already configured for use with cu, you couldn't dial out. For a minimal configuration for dial-out capability, you only need to modify one UUCP file--/etc/uucp/Devices--to connect to the outside world. The /etc/uucp/Devices file tells the UUCP utilities which devices they can use to contact remote machines.

You can edit the Devices file with your favorite text editor. Assuming that you have a Hayes-compatible modem connected to the first serial port on your computer, add the following lines to the end of the Devices file:

ACU ttya - Any hayes

Direct ttya - Any direct

Make sure there are no blank spaces at the beginning of these lines. Any line within the Devices file that begins with a blank will be considered to be a comment. Lines beginning with a # symbol are also considered comments.

Table A provides the definitions of the fields in the Devices file. The first line we added to the file specifies that an Automatic Calling Unit (e.g., a modem) is connected to the serial line /dev/ttya, that connections can be made at any speed, and that a Hayes-compatible dialer program will be used to issue commands to the modem.

Table A

Field #/Description

1 Device type (either ACU or Direct)

2 Device to use for the connection

3 Dialer-line (this field is archaic; just use a "-")

4 Connection speed

5 Dialer-token (hayes uses the Hayes command set for dialing; Direct assumes a connection is already made and this field is not required.)

If you're using a Hayes-compatible modem on your serial port, this configuration line lets you submit a phone number to the cu command, and the dialer program takes care of the rest of the work. For example, the following command dials the phone number 568-6250:

# cu 5686250

The second line we added to the Devices file specifies that we also have a direct connection to the serial line /dev/ttya. You use this configuration line to allow direct access to the modem, in case you need to issue special commands, such as at or atz0.

Testing the Devices file changes

Once you've made these changes to the Devices file, you can connect to the modem directly with the command

# cu -lttya

where the -l command-line switch tells the cu program the device to which you want to establish a connection.

If this command succeeds, you'll see the message Connected from the computer system. You can now type commands from the Hayes command set, such as AT, and your modem should respond with the usual OK message, as shown below:

# cu -lttya

Connected

at

OK

If you see these messages, congratulations! You've done everything you need to dial out from your system. If you make an error configuring your Devices file, cu may give you an error message like this:

# cu -lttya

Connect failed: NO DEVICES AVAILABLE

If you don't see these messages displayed on your screen, it might be because your modem isn't turned on, your modem may be connected to the wrong port, the port may not be enabled properly, or you may be using an incorrectly-configured cable. Please read your modem's installation manual before proceeding any further.

Once you successfully configure your system, you can either try dialing out to another system with the ATDT or ATDP commands, or you can disconnect from the modem. To disconnect, type the special character sequence ~. (a tilde followed by a period) and press [Enter]. The system should respond with the Disconnected message and return you to your UNIX prompt.

The entire connection sequence should look like this:

# cu -lttya

Connected

at

OK

~voyager.

Disconnected

Take a look at the fifth line. While you typed only the character sequence ~. the cu program displayed the system name between the characters you typed.

Modifying the Systems file

With your current setup, you can call any computer in the outside world by either specifying its phone number or connecting to the ttya device and then issuing an ATDT or ATDP modem command. If you change an additional UUCP configuration file, you can call remote systems by name, such as

# cu compuserve

The file you'll need to change is called /etc/uucp/Systems. In this file, you specify the names of computer systems to which you may want to connect, as well as some additional information, like the phone number and connection type.

For instance, if your local CompuServe phone number is 568-6250, you can add the following line to your Systems file:

compuserve Any ACU Any 5686250

Table B describes the field definitions for the Systems file.

Table B

Field #/Description

1 Name of the remote site

2 Calling schedule--Any allows calls at any time of day; Never disallows callouts using this entry.

3 Device type (ACU or Direct)

4 Connection speed

5 Phone number of the remote site

6 Login conversation script (not used in this article).

Please note that only the first seven letters of the remote site name are expected to be unique. Therefore, you must be careful when setting up the Systems file to ensure that no two site names start with the same two letters.

After you configure your Systems file, you can easily dial in to CompuServe by typing

# cu compuserve

Conclusion

Once you've configured the Devices and Systems files, you and every user on your workstation can dial out to remote computer sites to run remote applications and transfer files. An additional benefit is that you've begun to configure your entire UUCP system. If your business has several geographically separated offices, you can continue the UUCP setup to further enable scheduled remote logins, file transfers, and site-to-site E-mail.

Alvin J. Alexander is an independent consultant specializing in UNIX and the Internet. He has worked on UNIX networks to support the Space Shuttle, international clients, and various Internet service providers. He has provided UNIX and Internet training to over 400 clients in the last three years.


[Return to Index for Inside Solaris - May 1996 Issue]

Copyright (c) 1996 The Cobb Group, a division of Ziff-Davis Publishing Company. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff-Davis Publishing Company is prohibited. The Cobb Group and The Cobb Group logo are trademarks of Ziff-Davis Publishing Company.

Inside Solaris is a publication of The Cobb Group.
1-800-223-8720